<div class="modal fade " id="dataFileInfoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="width:60%">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">文件列表</h3>
                <button type="button" class="btn btn-danger pull-right" data-dismiss="modal">关闭</button>
            </div>
            <form class="form-horizontal">
                    <div class="box-body" id="infoCustScoreBodyDiv">
                        <input id="modalExchangeInfoId" type="hidden"  />
                        <table id="dataFileInfoTable" data-toggle="table"  data-search="true"  data-pagination="true"
                               data-sort-name="id" data-sort-order="desc"
                               data-query-params="dataFileInfoTableQueryParams"
                               data-url="/datafileinfo/list">
                            <thead>
                            <tr>
                                <th data-field="state" data-checkbox="true" data-formatter="dataFileInfoModalCheckBoxFormatter">选择</th>
                                <th data-field="name">文件名称</th>
                                <th data-field="type" data-formatter="typeFormatter">文件类型</th>
                                <th data-field="fileName">文件结果名称</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="box-footer">
                        <button type="button" class="btn btn-default pull-right" data-dismiss="modal">完成</button>
                    </div>
                    <!-- /.box-footer -->
            </form>
        </div>
    </div>
</div>
<script>
    function dataFileInfoModalCheckBoxFormatter(value, row, index) {
        if (row.isSelected == "1") {
            return {checked: true};
        } else {
            return value;
        }
    }
    function initDataFileInfoModal(exchangeInfoId) {
        $("#modalExchangeInfoId").val(exchangeInfoId);
        $("#dataFileInfoTable").bootstrapTable('refresh');
    }
    function dataFileInfoTableQueryParams() {
        return {
            exchangeInfoId:$("#modalExchangeInfoId").val()
        }
    }
    function typeFormatter(value, row, index) {
        if(value == "1") {
            return "HTTP获取";
        } else if(value == "2") {
            return "SMB获取";
        } else if(value == "3") {
            return "FTP获取";
        } else if(value == "4") {
            return "MAIL获取";
        } else if(value == "5") {
            return "txt";
        } else if(value == "6") {
            return "SQL生成";
        } else if(value == "7") {
            return "公共备份";
        }
        return value;
    }
</script>